#ifndef MUSIC_CONSTRAINTS_H
#define MUSIC_CONSTRAINTS_H

#include <gecode/minimodel.hh>

#include "core/lilypond_writer.h"

class QString;

class MusicConstraints;
class MusicSettings;

using namespace Gecode;

/*!
 * Script pour les contraintes musicales
 */
class MusicConstraints: public Space {
  private:
    MusicSettings *settings;

  public:
    IntVarArray pitch; // tableau des hauteur
    IntVarArray octave; // tableau des octaves

    MusicConstraints(MusicSettings *);

    void writeLy(QString, LilyPondWriter::Usage);

  private:
    MusicConstraints(bool, MusicConstraints &);

    virtual Space *copy(bool);

    void scaleConstraint();
    void conjointConstraint();
    void noRepetitionConstraint();
    void simplePatternConstraint();
    void advancedPatternConstraint();
    void firstNote();
};

#endif
